package com.likou.written.huayu;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Author: 陈桂明
 * Date: 2025/10/25 22:34
 * Description: huayu2
 */
public class huayu2 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        String expr = in.nextLine();

        List<Integer> nums = new ArrayList<>();
        List<Character> ops = new ArrayList<>();

        nums.add(expr.charAt(0) - '0');
        for (int i = 1; i < expr.length(); i += 2) {
            ops.add(expr.charAt(i));
            nums.add(expr.charAt(i + 1) - '0');
        }

        int i = 0;
        while (i < ops.size()) {
            if (ops.get(i) == '*') {
                int product = nums.get(i) * nums.get(i + 1);
                nums.set(i, product);
                nums.remove(i + 1);
                ops.remove(i);
            } else {
                i++;
            }
        }

        int result = nums.get(0);
        for (int j = 0; j < ops.size(); j++) {
            char op = ops.get(j);
            if (op == '+') {
                result += nums.get(j + 1);
            } else if (op == '-') {
                result -= nums.get(j + 1);
            }
        }
        System.out.println(result);
    }

}
